<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>多进程</title>
</head>
<body>
多进程<br/>
<input type="text" id="txt1">
<input type="text" id="txt2">
<input type="button" id="btn1" value="计算">
<script>
window.onload=function () {
    let oBtn = document.getElementById('btn1');
	let oTxt1 = document.getElementById('txt1');
	let oTxt2 = document.getElementById('txt2');
	oBtn.onclick=function () {
		let n1 = oTxt1.value;
		let n2 = oTxt2.value;

		let w = new Worker("w1.js");
		w.sendme(n1,n2);
	}
}
</script>
</body>
</html>